VB .NET Windows Apps1. You are in the process of debugging a large Windows-based application created using Visual Studio .NET development tools. You would like to provide two separate versions of the application and to do so you require the use of one of two different sets of constants based on conditions of the compile. Which two of the following is a correct implementation of the constants? A. Use resource files and set the application up for localization B. Uses #Const directives in the code C. Use an input file to supply values based on conditions of the compile D. Set the constants up in the conditional compilation declaration space E. Set the application up as a function with runtime parameters and have the user pass the appropriate data through a console interface
2. You are a developer for a scientific research company the uses Visual Studio .NET to generate Windows-based applications. Most of the applications perform a variety of calculations. In the testing process of an application you must ensure that the application properly handles specific ranges of data. You would like to identify the point at which a variable exceeds an upper limit of 64000. You want your application to generate a message in these cases. Which statement would you use? A. Trace.Assert(TestValue < 64000, "Maximum value surpassed.") B. Trace.Assert(TestValue >= 64000, "Maximum value surpassed.") C. Trace.Assert("Maximum value surpassed.", TestValue < 64000) D. Trace.Assert("Maximum value surpassed.", TestValue >= 64000)
3. You are working as a Visual Basic developer for a large manufacturing company ACME Widgets. ACME has recently standardized development on the .NET framework using Visual Studio .NET. The application that you are working on is an upgrade of a previous Visual Basic 6.0 application. It was developed by a colleague that is no longer with the company. The application performs a number of complex calculations to determine the size and shape of the Widgets. All of the variables are defined as double precision numeric variables. Occasionally the application fails during execution. The error received is "Arithmetic operation resulted in an overflow". How can you fix the program? A. Set Option Strict to Off B. Set Option Explicit On C. Set Option Compare On D. Set Option Strict to On
4. You are working for a large manufacturing organization that uses Visual Basic .NET for application development. You are assigned to a group of developers whom together are developing an application to monitor progress of Widget manufacturing and assembly. You are assigned to create a Windows control that will display custom status bar information. The information will frequently change as the Widgets progress from raw materials to finished product. Many different developers in your company will use the control to display similar information in their applications. It is necessary to have the control always positioned at the bottom of the form in every application. Select the most appropriate answer: A. DockStyle.Bottom B. AnchorStyle.Bottom C. Control.Location New Point(0, 0) D. Choose Arrange from the Layout menu, and then choose Bottom
5. You are a developer for a government service organization that provides assistance to the public in interacting with several ministries. One of the applications you are working on contains a complex Windows form that needs to provide online help for end users. You need to supply help in the form of a pop-up window for the control that currently has the focus if the user presses the F1 key. You will need to interact with the HelpProvider control passing the text box control and the help text to be displayed. Which method of the HelpProvider control will provide this functionality? A. SetShowHelp B. SetHelpString C. SetHelpKeyword D. SetHelpNavigator
6. You are working as one of several developers for an organization that handles transactions for various e-commerce web sites. One of the developers on your team has created a component named BuyIt. You install the BuyIt component to a server but upon execution you receive an error message: "System.Security.Policy.PolicyException: Failed to acquire required permissions." You need to discover what the required permissions are as quickly as possible and the originating developer is out of the office. What can you do? A. Use the Runtime Debugger (Cordbg.exe) tool on the server. B. Use the Runtime Debugger (Cordbg.exe) tool on a developer workstation. C. Run the Permissions View tool (Permview.exe) on the server. D. Run the Permissions View tool (Permview.exe) on a developer workstation. E. Wait for the developer to return and acquire the source code. Examine the code to find the required permissions.
7. You are working as a developer for a small accounting firm, Book 'Em. On a form within a Windows-based application you are designing, you wish to have menus that will be created and altered at run time based on user interaction. In some instances there will be no menus while at other times the menus can be considerable. For the purpose of maintaining efficiency you have chosen to not provide any menus at design time. In one section of code you need to initialize the menu with the text "Insert". Under "Insert" you need to place "From File". A MainMenu component is already added to the form. What is required to implement this at runtime? (Choose all that apply) A. Dim mnuMenu as New MainMenu() Me.Menu = mnuMenu B. Dim mnuInsertMenu as New MenuItem("&Insert") Dim mnuFromFileMenu as New MenuItem("&From File") C. Dim mnuInsertMenu as New MainMenu("&Insert") Dim mnuFromFileMenu as New MenuItem("&From File") D. mnuMenu.MenuItems.Add(mnuInsertMenu) mnuInsertMenu.MenuItems.Add(mnuFromFileMenu) E. mnuInsertMenu.MenuItems.Add(mnuFromFileMenu) F. Dim mnuMenu as New MainMenu("&Insert") Me.Menu = mnuMenu
8. You are developing a process for a manufacturing application to be used on the company intranet. You want to return a string, "Pass" or "Fail" based on a decision made. You need to evaluate the TestMe parameter of the CheckIt procedure and return the word "Large" if the amount is greater than 1000; otherwise, it returns the word "Small". Which of the following represents the fewest number of commands in which this operation can be performed? A. Function CheckIt (ByVal TestMe As Integer) As String CheckIt = IIf(TestMe > currAcc, "Pass", "Fail") End Function B. Function CheckIt (ByVal TestMe As Integer) As String If TestMe > currAcc then CheckIt = "Pass" Else CheckIt = "Fail" EndIf End Function C. Function CheckIt (ByVal TestMe As Integer) As String If TestMe > currAcc then Return "Pass" Else Return "Fail" EndIf End Function D. Function CheckIt (ByVal TestMe As Integer) As String CheckIt = "Fail" If TestMe > currAcc then CheckIt = "Pass" End Function
9. You are the primary developer on a large project that will be released as a series of Windows-based applications. One of the forms in the application contains a collection of text objects. You need to write code that will apply a business rule against every object in the collection. You need to scan each element for the existence of the string "Fail". MyObject is a text-related object and is an element of the collection MyCollection. If any element fails all elements will be rejected. A. Dim Found As Boolean = False Dim MyObject, MyCollection As Object For Each MyObject In MyCollection If CStr(MyObject.Text) = "Fail" Then Found = True Exit For End If Next B. Dim Found As Boolean = False Dim MyObject, MyCollection As Object For Each MyObject In MyCollection If CStr(MyObject.Text) = "Fail" Then Found = True ' Set Found to True. End If Next C. Dim Found As Boolean = False Dim MyObject, MyCollection As Object For a = 1 to MyCollection.count - 1 If CStr(MyObject(a).Text) = "Fail" Then Found = True End If Next D. Dim Found As Boolean = False Dim MyObject, MyCollection As Object If CStr(MyCollection.MyObject.Text) = "Fail" Then Found = True
10. You are preparing an application that is to be used by a number of government agencies at the municipal level to provide services to handicapped individuals in the community. In the application you want to code a name for each control that will identify the control such as a RedButton or ItalicTextBox. What property of the control would you set? A. Name B. AccessibleName C. ShowFocusCues D. IMEMode
11. The retail company, that develop for has been using a Visual Studio project for some time. You use Visual Studio. NET to develop a Windows-based application. You plan to reuse a procedure written in Visual Basic 6.0. The procedure includes the following array declaration: Dim Occupant (1 to 5) As String You copy and paste the array declaration from the Visual Basic 6.0 project into the new VB .NET project. Now you must ensure that the Employees array will compile in the VB .NET application. What alterations must be made to support the code? A. Dim Occupant(0 to 4) As String B. Include Option Base 1 in the module Declaration C. Include Option Base 0 in the module Declaration D. Dim Occupant(4) As String
12. The manufacturing company where you work as a developer is upgrading from Visual Basic 6 to Visual Basic .NET. Over the next several months you will be upgrading applications to the .NET framework. A routine that your company has been using stores date information into variables for numeric processing. The Visual Basic 6.0 program has been working flawlessly for some time. The code is as follows: Dim dblDate As Double Dim dat As Date dat = Now dblDate = dat ProcessDate(dblDate) What aspect of Visual Studio.NET will indicate a need to rewrite the code? A. Visual Basic.NET does not support the storing of dates in double variables B. The Now function does not returns date type C. The Double data type has changed D. You must use a CDate function to store a double back into the date
13. You are developing a Windows-based application for a large law office, Brindle, Brandle and Jones. The client side of an application you are developing will notify a process when an incoming file has arrived at a file server located on the network. A portion of the code is as follows: Public Class Class1 Public Event FilePreserve_Event() Sub FileArrived() RaiseEvent FilePreserve_Event() End Sub End Class Which of the following code will be required in the to handle the event? A. Sub Filed() Dim Obj As New Class1() AddHandler Obj.FilePreserve_Event, AddressOf EventHandler Obj.FileArrived() End Sub Sub EventHandler() ' Handle the event. End Sub B. Sub Filed() Dim Obj As New Class1() Call Obj.FilePreserve_Event, AddressOf EventHandler Obj.FileArrived() End Sub Sub EventHandler() ' Handle the event. End Sub C. Sub Filed() Dim Obj As New Class1() Call Obj.FilePreserve_Event, EventHandler Obj.FileArrived() End Sub Sub EventHandler() ' Handle the event. End Sub D. Sub Filed() Dim Obj As New Class1() AddHandler Obj.FilePreserve_Event, EventHandler Obj.FileArrived() End Sub Sub EventHandler() ' Handle the event. End Sub
14. You are working as a developer for a hobby machinery manufacturer. Shizoo Manufacturing Inc. The company manufactures and sells a variety of snowmobiles and equipment as well in the future it plans on releasing the new Jezoo Sea Ski. The model will be available in standard colors. The application you are developing must present these colors on the interface upon selection from a dropdown list box. Which of the following would be used define a set of named constants for the color schemes? A. Public Const InterfaceColors MistyRose = &HE1E4FF& SlateGray = &H908070& DeepSkyBlue = &HFFBF00& ForestGreen = &H228B22& End Const B. Public Sub InterfaceColors Const MistyRose = &HE1E4FF& Const SlateGray = &H908070& Const DeepSkyBlue = &HFFBF00& Const ForestGreen = &H228B22& End Sub C. Public Enum InterfaceColors MistyRose = &HE1E4FF& SlateGray = &H908070& DeepSkyBlue = &HFFBF00& ForestGreen = &H228B22& End Enum D. Public Function InterfaceColors(Choice as string) As Color Select Case Chocie Case "MistyRose" InterfaceColors = &HE1E4FF& Case "SlateGray" InterfaceColors = &H908070& Case "DeepSkyBlue" InterfaceColors = & HFFBF00& Case Else InterfaceColors = &H228B22& amp; End Select End Function
15. As a Visual Basic.NET developer you are designing a Windows-based application for a small retail store. You are using a multi-dimensional array to hold a series of integer values. At one stage during the processing you need to enlarge the array. You want to increase the size of the last dimension of an array without losing any existing data in the array. The original array is defined as follows:A = 10Dim IntArray(10, 10, A) As Integer How would you increase the size of the dynamic array? A. A += 10 ReDim Preserve IntArray(10, 10, A) B. A += 10 C. You cannot perform this operation without using a collection D. A += 10 ReDim IntArray(10, 10, A)
16. You are creating a sales application using Visual Basic .NET for a small retail company. You have create the ICustomerInfo interface which is defined as follows: Interface IcustomerInfo Property CustomerName() As String Sub UpdateCustomerStatus() Event UpdateComplete() End Interface You now need to code the CustomerInfo class so that it can Use this inferface. Which of the following is correct for interface inheritance? A. Public Class ICustomerInfo Implements CustomerInfo B. Public Class CustomerInfo Inherits ICustomerInfo C. Public Class CustomerInfo Inherits Interfaces ICustomerInfo D. Public Class CustomerInfo Implements ICustomerInfo E. Public Class ICustomerInfo Inherits CustomerInfo
17. You are consulting for a large manufacturing organization that has a completely object oriented approach to development. Recently the have begun using Visual Basic .NET to implement the .NET framework in the organization's automated processes. An application that you are using needs to access the Microsoft.VisualBasic.Strings namespace and shortcut the namespace to a variable. Which of the following provides the requested functionality? A. Imports Str = Microsoft.VisualBasic.Strings Class MyClass1 Function Sub ShowIt(Inne as String) MsgBox(Str.Left(Inne, 5)) End Function End Class B. Class MyClass1 Function Sub ShowIt(Inne as String) Imports Str = Microsoft.VisualBasic.Strings MsgBox(Str.Left(Inne, 5)) End Function C. Imports Microsoft.VisualBasic.Strings Class MyClass1 Function Sub ShowIt(Inne as String) Str = "Microsoft.VisualBasic.Strings" MsgBox(Str.Left(Inne, 5)) End Function D. Imports Microsoft.VisualBasic.Strings Class MyClass1 Function Sub ShowIt(Inne as String) MsgBox(Microsoft.VisualBasic.Strings.Str.Left(Inne, 5)) End Function
18. You work for a small retail company that uses Visual Studio .NET products for the development of Windows-based applications. As one of several Visual Basic .NET developers you are designing an application that can optionally print the contents of client information from a Windows form. You implement standard .NET printing functionality and find that often only a portion of the information for a client is printed. Which of the following circumstances could be causing the problem? A. QueryPageSettings did not set information for the current page B. The user has no printers installed C. The HasMorePages property of the PrintPageEventsArgs object is set to false D. The default printer on the user's computer has been paused E. The PrintPageEventArgs.Cancel property is set to true while the data is printing
19. You work as a developer for a consulting firm that used Visual Studio .NET to deploy an application based on the .NET framework. You create a Windows-based application using Visual Basic .NET. The application will allow clients to prepare application outlines and then email the outline to a service account. You will need to distribute the application to your customers via an Internet download. You need to create a shortcut to your application on the User's desktop of the client's computer. What do you do in your setup project to accommodate the shortcut? A. Provide an Icon for the main form and Visual Basic .NET will use this as the shortcut for the desktop B. On the project properties of the application, indicate the location for the shortcut to be the User's desktop C. On the setup program's properties of the application indicate the location for the shortcut to be the User's desktop D. Select "Primary output" from the application. Create a Shortcut to the User's Desktop folder
20. You use Visual Studio .NET to create a Windows-based application. The application is used to accentuate presentations to management. You will use a form that appears transparent over the area it is covering. How do you accomplish this? A. Set the foreground and background colors to white B. Set the form's TransparencyKey to white C. Set the foreground color to white D. Set the form's opacity to zero percent E. Display the form as a modal form F. Set the forms background color to white
21. You are the primary developer for a small retail store. You are working on an application that will handle credit card purchases from the store's data terminals. You use Visual Studio .NET to create a component named AuthorizeCredit. This component includes a method named Accept, which tries to process new purchases. Accept calls a private function named Validate. You must ensure that any problems encountered by the Validate function are returned to the form that contains the AuthorizeCredit component. What is the best solution? A. Try Me.Validate() Catch Exc As Exception Throw Exc End Try B. Me.Validate() C. Try Me.Validate() Catch Exc As Exception Throw new Exception ("Exception in AcceptRequest", Exc) End Try D. Catch e as OverflowException Throw New OverflowException( "An overflow occurred in the Widget component")
22. You are a developer for a large consulting firm. The company has used Visual Studio .NET to create an accounting application. The application has a variety of classes for each significant interaction. One of the classes supported is the VendorAccountClass. This class instantiates several classes from a COM component that was created previously using Visual Basic 6.0. Each COM component class includes a custom method named CloseObject that must be called before terminating references to the class. When you run the application the COM component appears to remain in memory even after the application terminates. You must ensure that the CloseObject method of each COM component class is called before VendorAccountsClass is terminated. How do you fix the problem? A. Add code to the Terminate event of VendorAccountsClass to call the CloseObject method of each COM component class. B. Add the procedure Protected Overrides Finalize() to VendorAccountsClass. Add code to the procedure to call the CloseObject method of each COM component class. C. Execute a DoEvents command in the Finalize routine for the component. D. Execute a directory entry remove command from the finalize routine of the component.
23. As a Visual Basic.NET developer you are creating a Windows-based application for a small retail company. During the finalization of processes the application will need to record entries into the registry on the client's computer. You need to create a registry key that has two subordinate keys. What code is required? A. SaveSetting("RetailApp","Startup","NumberOne","Entry1") SaveSetting("RetailApp","NumberOne","NumberOneAy","Entry1A") SaveSetting("RetailApp","NumberOne","NumberOneBee","Entry1B") B. SaveSetting("RetailApp","Startup","NumberOne","Entry1") SetAttr("RetailApp NumberOne NumberOneAy Entry1A", vbReadOnly) SetAttr("RetailApp NumberOne NumberOneBee Entry1B", vbReadOnly) C. SaveSetting("RetailApp","Startup","NumberOne","Entry1") SSett = RSet("RetailApp, NumberOne, NumberOneAy, Entry1A", 10) SSett = RSet("RetailApp, NumberOne, NumberOneBee, Entry1B", 10) D. SaveSetting("RetailApp","Startup","NumberOne","Entry1") SSett.Add("RetailApp NumberOne NumberOneAy Entry1A", vbReadOnly) SSett.Add("RetailApp NumberOne NumberOneBee Entry1B", vbReadOnly)
24. You are a developer for the small accounting firm, Book 'Em. You use Visual Studio .NET as your primary tool to create a Windows-based application. You are working with an application that will display profit and loss figures for the past ten years. The application uses line graphs plotted to specific pixel locations on the display form ShowsItForm. Because of the nature of the display you would like the form to always be a static size. To ensure that a user cannot resize, minimize, or maximize the form you will have to alter a number of properties. Which three settings would you ensure are present? Each answer will represent a portion of the solution. . . (Choose all that apply) A. Set ShowsItForm.MaximizeBox to False B. Set ShowsItForm.MinimizeBox to False C. Set ShowsItForm.Size and Location properties to specific Width and Height D. Set ShowsItForm to be displayed as a modal dialogue E. Set ShowsItForm.FormBorderStyle to one of the Fixed styles F. Set ShowsItForm.WindowState to Maximized
25. You are the developer for a construction company that develops large parcels of land in very remote areas. Most of these parcels will be purchased by corporate executives from large companies as retreats. Each of the parcels of land has essentially the same base information but also each will have special considerations. You create the basic form with the common elements. You want this form to be inherited and then added to at run time. The newly combined form will have both the base elements and the elements specific to the current parcel. The namespace of the current project is ParcelPro while the namespace that the original form resides in is called GenericParcels. You have made a reference to the GenericParcels namespace. What code is needed to use the BaseForm created? A. Dim Form2 as New GenericParcels.BaseForm B. Dim Form2 as New ParcelPro.BaseForm C. Public Class Form2 Inherits ParcelPro.BaseForm D. Public Class Form2 Inherits GenericParcels.BaseForm
26. As a Visual Basic.NET developer for a small retail franchise, you are creating an application that will act as a server component for a variety of clients. Your component will be used by other Visual Studio .NET language applications and legacy environments as well. You want to create a single assembly and use that assembly to install and register the component on all clients. What should you do? A. Use Assembly Registration tool (Regasm) to generate a type library file. B. Use Assembly Registration tool (Regasm) to generate a registry file. C. Use the Type Library Exporter tool (Tlbexp) to generate a registry file. D. Use the Type Library Exporter tool (Tlbexp) to generate a type library file.
27. You are developing a set of Windows-based applications. The applications that you are building can each run as a stand alone application or contribute information to each other in alternate instances. You must ensure that when running on the same machine the two applications can share information while at the same time run independently when needed. How would you deploy the assemblies? A. Use the Global Assembly cache tool to ensure that the applications communicate through the common runtime environment. B. Use the Assembly linker to unite the resources used by each application. C. Use the Certificate Management tool and apply the same certificate to all applications. D. Ensure that calls to other applications are passed through the Web Services Discovery tool.
28. You are working as a Visual Studio.NET developer for a small retail company. You are about to deploy an application to the computers in the administrative office. You create an application configuration file that will be installed on the client computer along with the application. You must ensure that the settings in the application configuration file are applied to the application it is executed. How do you deploy the configuration? A. Give the configuration the same name as the application with a ".exe" extension and then copy it to the Windows\System32 folder. B. Give the configuration the same name as the application with a ".exe" extension and then copy it to the global assembly cache. C. Give the configuration the same name as the application with a "cfg" extension and then copy it to the Windows\Sytem32 folder. D. Give the configuration the same name as the application with an ".exe" extension and then copy it to the application folder. E. Give the configuration the same name as the application with a ".cfg" extension and then copy it to the global assembly cache. F. Give the configuration the same name as the application with a ".cfg" extension and then copy it to the application folder.
29. You are working for a large manufacturing firm that has standardized development on the .NET Framework as its software development platform, Visual Studio.NET. The company has a policy of not allowing execution of any applications downloaded from the Internet because of virus problems and other security concerns. You must ensure that all client computers on your intranet can execute all .NET applications originating from your company but not allow any from the Internet. Which type of policy should you implement? A. Machine B. Application Domain C. Enterprise D. User
30. You are working as one of the primary developers for a large construction company that has a variety of properties in the area. The development team is currently working on a number of applications that communicate using a Windows-based application and XML Web services. A WAN outage has caused a disconnected state between the server containing the Web Services and your development environment. You need to develop the client solely based on the content of the Web Services description file. its description file. How can you begin the coding of the client interface? A. Use the Soapsuds tool to compile the application. B. Use the Discovery tool to gain access to the Web Services. C. Use Web Services Description Language tool to generate a proxy class for each service. D. Use the Isolated Storage tool to access the Web Services description.
31. You are preparing a task management application that uses the TaskMgmtWS Web service to update a DataGrid control. The application starts by instantiating an XML Web service object named ws. Then, a call is made to the web method GetTasks() to get an ADO.NET DataSet of tasks. You now need to set up the tasks DataSet. You have the following code: (Numbers are added for reference only)
A. DataGrid1.DataSource = dsDataGrid1.BoundColumn = "Tasks" B. DataGrid1.DataSource = "Tasks"DataGrid1.DataMember = ds C. DataGrid1.DataMember = dsDataGrid1.BoundColumn = "Tasks" D. DataGrid1.DataSource = dsDataGrid1.DataMember = "Tasks"
32. You are the primary developer working as a consultant for a large manufacturing company, ACME Widgets. You develop a Windows-Based application that accesses a SQL Server. Users supply a user name and password when they start the application. This user id and password supplied is then used to dynamically build a connection string and log the user in as a standard SQL user across non-trusted connections. When you test the application, you discover that it is not using the SqlClient connection pooling feature. How should you modify the connection string? A. Use the SQL Server used login when connecting to the database. B. Use the same logon ID and password for every connection. C. Use the guest login ID and password for every connection. D. Use the Windows user logon when connection to the database.
33. You are one of many developers that work as a team in a large manufacturing company, ACME Widgets. Your team is developing a 3-tier application that includes a Windows-based user interface, business logic supplied by middle-tier components, and a large data warehouse operating on Microsoft SQL Server. You are in the process of creating one of the middle-tier components. The component will be accessing data on behalf of the user. The process involves calling several SQL Server stored procedures. These procedures must run under the umbrella of a single transaction. You must prevent two users from being able to update the same data concurrently. Select One A. Dim conn As New SqlConnection() Dim tran As SqlTransaction tran = cn.BeginTransaction(IsolationLevel.Serializable) B. Dim conn As New SqlConnection() Dim tran As SqlTransaction tran = conn.BeginTransaction("ReadCommitted") C. Dim conn As New SqlConnection() Dim tran As SqlTransaction tran = conn.BeginTransaction(IsolationLevel.ReadCommitted) D. Dim conn As New SqlConnection() Dim tran As SqlTransaction tran = conn.BeginTransaction("Serializable")
34. You are working as a developer for a small retail operation that deals with many different wholesalers form around the world. You are developing a Windows-based application using Visual Basic .NET. Your application will receive XML data from the separate vendors and associate the supplied XML Schema so that the format and the data types for the XML data can be applied against the same database. The process in your application must take the XML data and make sure that it is valid by using the schema supplied. How do you ensure the data is valid? A. Implement an XmlValidatingReader object and code an event handler. B. Implement an XmlValidatingReader object and examine the errors collection. C. Implement the XMLValidatingReader and examine the CanResolveEntity property. D. Implement the XMLValidatingReader and cycle through the data testing the data against middle tier business rules.
35. You are one of the primary developers for a large manufacturing organization ACME Widgets. You are working with a team of developers to create an inventory management application. The application will interact with a database on a SQL Server that is located on the company intranet. You need to display information in a text property of the PurchaseOrder object. You need to access a stored procedure on the server to perform some of the functionality in your application. The stored procedure will provide calculated information and return the result from the call as an output parameter. Thus far the code for the routine is as follows:Dim cnn As SqlConnection = New SqlConnection(myCStr) Dim cmd As SqlCommand = New SqlCommand("sp_CalculatePurchaseLevel", cnn) cmd.CommandType = CommandType.StoredProcedure Dim parm As SqlParameter = cmd.Parameters.Add("@CRes", SqlDbType.Int) parm.Direction =ParameterDirection.Output cnn.Open() cmd.ExecuteNonQuery() Which code segment is now needed? A. CalcResultString = cmd.Parameters("@CRes").Value.ToString()) B. CalcResultString = cmd.Parameters("@Output").Value.ToString()) C. CalcResultString = cmd.Parameters("@Output").ToString()) D. CalcResult = cmd.Parameters("@CRes").ToString())
36. You use Visual Basic .NET to develop a Windows-based application for a large manufacturing company ACME Widgets. Your application will display data retrieved from a Microsoft SQL Server database. The data is displayed on a Windows Form with invoice general information in text boxes and detail data in a grid control named InvoiceGrid. InvoiceGrid has been bound to a DataView object named InvDatVw. InvoiceGrid displays invoice information for the current order being processed and that information can be identified by the InvoiceNumberID. The InvoiceNumberID is held in a drop down list box called InvoiceIDList. How do you ensure that only the necessary data is stored in a local recordset? A. Set the RowFilter property of the DataView object to "InvoiceNumberID = " & InvoiceIDList.Text" B. Set the RowFilter property of the DataView object to "InvoiceNumberID = " & InvoiceIDList.SelectedText" C. Set the RowFilter property of the DataView object to "InvoiceNumberID = " & InvoiceIDList.ItemData" D. Set the RowStateFilter property of the DataView object to "InvoiceNumberID = " & InvoiceIDList.Text" E. Use the FindRows method of the DataView object to filter based on the "InvoiceNumberID = " & InvoiceIDList.Text"
37. You are a Windows-based developer that uses Visual Basic .NET to create data aware applications that interact in two and three-tier environments. You want to create an application that will let sales clerks enter purchase orders. The application you are creating uses a DataSet and two DataTable objects. The purchase order will act as a primary key for the orders table while the order details table will use the purchase order and a sequential identity column set by SQL Server. There is a one-to-many relationship between orders and order items. How would your application define the primary keys? A. On the PurchaseOrder DataTable set the PrimaryKey property to a single element array referencing the PurchaseOrderNumber field and set the PrimaryKey property of the PurchaseOrderDetails DataTable to an array of DataColumn objects that reference the two columns that make up the primary key. B. On the PurchaseOrder DataTable set the PrimaryKey property to the PurchaseOrderNumber field and set the PrimaryKey property of the PurchaseOrderDetails DataTable to an array of DataColumn objects that reference the two columns that make up the primary key. C. On the PurchaseOrder DataTable set the PrimaryKey property to the PurchaseOrderNumber field and set the PrimaryKey property of the PurchaseOrderDetails DataTable to a concatenation of the two columns that make up the primary key. D. On the PurchaseOrder DataTable set the PrimaryKey property to the PurchaseOrderNumber field and set the PrimaryKey property of the PurchaseOrderDetails DataTable to the two columns that make up the primary key separated by a comma.
38. You are working on a new contract for a small consulting firm TOMORA Systems. You are in the process of developing a Windows-based application that generates output in the form of XML data. The XML output is generated by using the WriteXml method of the DataSet object. Once the data has been generated it is then sent to another application where the output is very specific in nature. You need to write the Visual Basic .NET code that will format the XML output for the second application. What code would you supply? A. FirstDataSet.WriteXmlSchema(txtFilename) B. FirstDataSet.WriteXmlSchema(txtFilename, XmlWriteMode.WriteSchema) C. FirstDataSet.WriteXml(txtFilename, XmlWriteMode.WriteSchema) D. FirstDataSet.WriteXmlSchema(txtFilename)
39. You are the primary Visual Basic developer on a team that uses Visual Studio .NET to develop Windows-based applications for a large manufacturing firm, ACME Widgets. The current application that you are debugging will connect to a Microsoft SQL Server database. When any error occurs as the user executes stored procedures from the database you would like to identify the situation. You are going to perform structured error handling in the application to capture the information about any of the errors. How would you identify errors in stored procedure calls? A. Try dbConnection.Open() Catch dbError as SQLException ' Error-handle. End Try B. Try dbConnection.Open() Catch dbError as SQLCommand ' Error-handle. End Try C. Try dbConnection.Open() Catch dbError as SQLConnection ' Error-handle. End Try D. Try dbConnection.Open() Catch dbError as SQLDebugging ' Error-handle. End Try E. Try dbConnection.Open() Catch dbError as SQLParameter ' Error-handle. End Try F. Try dbConnection.Open() Catch dbError as SQLTransaction ' Error-handle. End try
40. You are working as one of a team of developers for a consulting firm that performs systems integrations for various municipal governments. You develop a Windows-based application that interacts with several data stores on a Microsoft SQL Server that is located on the corporate network. The network has no external access to or from the Internet. You would like to optimize query performance for repeated execution of the same stored procedure. It seems that the first daily execution of the application does not respond quickly enough though subsequent executions are reasonable. How can you improve the performance of the initial execution? A. Call the SqlCommand.ResetCommandTimeout method on every call to a stored procedure. B. Call the SqlCommand.Prepare method on every call to a stored procedure. C. Call the SqlCommand.ExecuteReader method during the application's initialization phase. D. Call the SqlCommand.ExecuteReader method on every call to a stored procedure. E. Call the SqlCommand.Prepare method during the application's initialization phase. F. Call the SqlCommand.ResetCommandTimeout method during the application's initialization phase.
41. You are working as a member of a team of consultants that use Visual Studio .NET as the primary development tool. The Windows-based application that you are currently designing uses a SqlConnection object for database access. You typically run this application on a computer that has limited resources and you need to minimize the use of the application's local resources when dealing with large amounts of data. How do you ensure the SQLConnection is closed after it has completed its processing? A. Call the SQLConnection.GetDeleteCommand. B. Set the SQLConnection.DataAdapter property to false. C. Call SQLConnection.Dispose. D. Call SQLConnection.RefreshSchema.
42. You are working as a Visual Basic developer for a large construction company that specializes in purchasing and developing tracks of land that have been contaminated with environmental waste. You develop a Windows-based application that will track the cleaning of the soil from the sites. The soil must be totally removed and put through a sterilization process before it is safe for use. The database used to store the information is stored on a Microsoft SQL Server. Additions to the database will be made through a DataSet. You need to add tables to the existing DataSet. What is used to add the required tables? A. Use the Component Designer in a form or component. B. Use the XML Designer to modify the dataset schema. C. Have an SQL stored procedure produce the desired table from the query builder. D. Attach a file DSN to the project. E. You cannot add more tables.
43. You are developing a Windows-base application that will retrieve an XML file and schema. Once the information is retrieved, your application must obtain a copy of the structure of the DataSet including all components. The operation needs to be performed without copying the data. How do you obtain this functionality? A. Use the Copy method of the DataSet object. B. Use the Clone method of the DataSet object. C. Use the GetSchemaSerializable method of the DataSet object. D. Use the Merge method of the DataSet object.
44. You are developing a Windows-based application using Visual Basic .NET for a large manufacturing operation. The application will allow users to enter data in a series of text boxes. You must then have the application find the appropriate data from the database and allow standard add, change and delete operations to be performed. You want the users to have some flexibility on data entry searches so you would like to allow a search by entering only the first few characters of the last name being searched on. You would like to use a standard SQL query to accommodate this action. Which of the following is correct for the application? A. SQL = "SELECT * FROM Addresses WHERE LastName LIKE ''" & txtLastNameSearch & "%' " B. SQL = "SELECT * FROM Addresses WHERE LastName LIKE ''" & txtLastNameSearch & "*' ". C. The query must end up looking like SELECT * FROM Addresses WHERE Lastname IN "Jon%" D. The query must end up looking like SELECT * FROM Addresses WHERE Lastname = "Jon%" E. The query must end up looking like SELECT * FROM Addresses WHERE Lastname = "Jon*"
45. You use Visual Studio .NET to develop applications for a large manufacturing firm, ACME Widgets. The majority of the applications run across the corporate intranet using IIS web servers. All client computers have been standardized with Internet Explorer version 6.0. You plan to distribute your current application to all users through a web page link on a portion of the intranet set aside for application maintenance. The company has set up a policy whereby all applications must be able to be uninstalled through the control panel. What type of project would you create for your application? Select the most appropriate answer: A. CAB B. Merge Module C. Setup D. Web Setup
46. You are working as one of a number of developers on a consulting team for TOMORA Systems. You want to configure Control Panel support for an application you are developing. Particularly you would like the company name supplied as the support contact by the Add/Remove Programs option. Which property should you change? A. Manufacturer in the Application Project. B. Author in the Application Project. C. Manufacturer in the Setup Project. D. Author in the Setup Project.
47. You are working as a consultant on an extended contract for a large manufacturing company, ACME Widgets. You have created several useful ActiveX controls that you would like to protect against unauthorized use or alteration. You have to ensure that ACME can make full use of the control while protecting against the unlicensed use by other individuals or companies. You decide to use a license implemented by through the LicFileLicense Provider class. What must you do to protect the controls? A. Make a call to LicenseManager.Validate in the control's load event. B. Make a call to LicenseManager.CreateWithContext in the control's load event. C. Apply a LicenseProviderAttribute to the class of each control. D. Make a call to LicenseManager.LockContext in the control's load event. E. Apply a LicenseException to the class of each control.
48. You are working as a maintenance developer for a Midwestern Farming Cooperative. You have been assigned to alter an existing application that was created by another developer who has since left. After making a few minor alterations you try to build the application. The results of the compilation indicate numerous syntactical errors. In order to correct the errors as quickly as possible you need to find each error. Where would a list of errors be found? A. The Dynamic Help Window B. The Command Window C. The Object Browser D. In the code editor E. The Application event log F. The Task List window
49. You are working for an international company that has satellite offices around the globe. The company has standardized all operations around the .NET development platform and is in the process of upgrading all of its applications. The company needs an application that can operate within all cultural environments. How do you deploy the application? A. As a separate application for each language. B. Create a single application. Create a separate form for each language. C. Create separate resource files for each culture using the Windows Forms Resource Editor. D. Create a single application and provide a separate language file for each culture.
50. You are working as one of the primary Visual Studio.NET developers for a small manufacturing company ACME Widgets. You are currently working on a project that will use a Windows-based application. The application will perform numerous Assert, Deny and PermitOnly security operations while it is executing. You must ensure that the application is optimized for fast run-time execution without interfering or compromising the security operations. How should you optimize the security? A. Perform Imperative Security Checks. B. Perform declarative security checks. C. Use SQL Server Security options. D. Use the Operating Security options.
51. You are one of many Visual Studio .NET developers that work for a large web integration company. You are performing the deployment of a series of your own applications. You are concerned that the application's functionality may be lost if other developers overwrite your installation with your own. How would you secure your assembly? A. Ensure the assembly is not deployed to the Global Assembly Cache. B. Create a strong name assembly using the strong Name tool (Sn.exe). C. Create an Assembly manifest for the application. D. Use the MarshalByRefObject Class.
52. Which of the following are malicious threats to network security? A. Viruses B. Earthquakes C. Hackers and crackers D. Employees who don't know any better E. Power failures F. Disgruntled employees
53. You are a developer for a large government service organization that uses the .NET platform as a standard for the development of Windows-based applications. The application you are designing has an extended initialization process when it is first executed. You must ensure that the application starts as quickly as possible the first time it runs. How would you prepare the application? A. Precompile the application using the Visual Studio .NET, Native Image Generator (Ngen.exe). B. Prepare your application for the client computers and use the JIT compiler. C. Use the Global Assembly Cache tool (Gacutil.exe) to optimize the installation environment. D. Use the .NET Framework Configuration tool (Mscorcfg.msc) to optimize the runtime environment.
54. You are a developer for a company that uses Visual Studio .NET to supply shareware and freeware products for non-profit organizations. Some of these products are available on the Internet while others are available through mail order. You are developing a file sharing utility that will allow users from around the country to share their own materials. The application will display status information to the user in the form of string messages in a text box. You want the strings to be locally presented in the language of the user. You have prepared English, Spanish, French and Chinese resources. You want your application to be useable by others as well. How should you deploy the application? A. Package a main assembly for source code and the default culture. Package satellite assemblies for the other cultures. B. Package a different assembly for each culture. C. Package a different executable file for each culture. D. Package a main assembly for source code. Package satellite assemblies for each culture. Prepare other resources as they become available.
55. You are developing a project that will illustrate the functionality of structured exception handling. You will be using the project as a means of training new developers as they join the company. You enter the following code and are about to prepare documentation for the code:Public Sub TryExample() Try x /= y ' Causes a "Divide by Zero" error Catch ex As Exception When y = 0. MsgBox(ex.toString) Finally Beep() ' Beep after error processing. End TryEnd Sub When will the Beep() function execute? A. The Beep() will never execute. B. Only when an error occurs. C. Only if there is no error. D. Only if the error is resolved by the catch. E. Each time the code is executed regardless of whether there is an error.
56. You use Visual Studio .NET to develop a Windows-based application named Tamiskin Cooperative (TC). The TC has an Occupant class. The Occupant class is defined by the following code segment: Namespace Tamiskin.Coop.Database Public Class Occupant Public Function GetOccupantName(OccupantID as Integer) as String ... End Function ... End Class End Namespace The client class is invoked as follows: Public Class OccupantForm Inherits System.Windows.Forms.Form Private Sub SetOccupantName(ByVal PostalCode As String) Dim client as New Client() txtOccupantName.Text = client.GetOccupantName(postalcode) End Sub End Class When you try to build your project, you receive the following error message: "Type 'Occupant' is not defined." Which of the following solves the problem? A. Modify the code to create an overloaded procedure. B. Inherit and Override the function. C. Declare the function as NotOverridable. D. Declare the function as MustOverride.
57. You are in the process of developing a Windows-based application for a local legal services company. The application will process legal charges by passing an object array to a function. The function then uses a method to either update an existing record in the table or to add a new record. When you test your application, you frequently receive an exception of type InvalidCastException. What does the error represent? A. The data is not correct for that column being updated. B. You cannot pass an array of object variable types. C. The destination variables have to be object type variables. D. The variables should be passed as a collection instead.
58. You use Visual Studio .NET to develop components for a systems consulting firm TOMORA Systems. You are developing a component that provides corporate-specific data that you plan to use in a number of different client applications. You would like to deploy the component with each of the client applications that you create in the future. Which type of setup project should you use to create a distribution package? A. Use a Web Setup project. B. Use the CAB setup project. C. Use a basic Setup project. D. Use the Merge Module setup project.
59. You are done developing and testing your Windows application that uses Serviced Components and are ready to deploy it to all users throughout the company. You want the new application to be installed the next time the users log in to their work stations. How should you deploy this application? A. Create a Windows Installer application (.msi) and place it in the Active Directory Group Policies for electronic distribution to all users. B. Create a Windows Installer application (.msi) and email it to the users with instructions for installation. C. Create a custom executable (.exe) and email it to the users with instructions for installation. D. Create a custom executable (.exe) and place it in the Active Directory Group Policies for electronic distribution to all users.
60. You are a developer for a large consulting firm. The company has used Visual Studio .NET to create an accounting application. The application has a variety of classes for each significant interaction. One of the classes supported is the VendorAccountClass. This class instantiates several classes from a COM component that was created previously using Visual Basic 6.0. Each COM component class includes a custom method named CloseObject that must be called before terminating references to the class. When you run the application the COM component appears to remain in memory even after the application terminates. You must ensure that the CloseObject method of each COM component class is called before VendorAccountsClass is terminated. How do you fix the problem? A. Add the procedure Protected Overrides Finalize() to VendorAccountsClass. Add code to the procedure to call the CloseObject method of each COM component class. B. Add code to the Terminate event of VendorAccountsClass to call the CloseObject method of each COM component class. C. Execute a DoEvents command in the Finalize routine for the component. D. Execute a directory entry remove command from the finalize routine of the component.
|